﻿using System.Collections.Generic;
using System.Data;

namespace Ormon.HostLinkLib.FinsBase
{
    /// <summary>
    /// Fins通信结果类
    /// </summary>
    public class FinsResult
    {
        /// <summary>
        /// FINS通信状态
        /// </summary>
        public bool IsSuccessed { get; set; }

        /// <summary>
        /// FINS通信结果信息
        /// </summary>
        public string ResultMessage { get; set; }

        /// <summary>
        /// 通信命令帧
        /// </summary>
        public string CommandFrame { get; set; }

        /// <summary>
        /// 通信回复帧
        /// </summary>
        public string ResponseFrame { get; set; }

        /// <summary>
        /// 数据列表(bool类型)
        /// </summary>
        public List<bool> Datas_BoolList { get; set; }

        /// <summary>
        /// 数据列表(string类型)
        /// </summary>
        public string Datas_String { get; set; }


        /// <summary>
        /// 完整构造函数
        /// </summary>
        /// <param name="isSuccessed">FINS通信状态</param>
        /// <param name="resultMessage">FINS通信结果信息</param>
        /// <param name="commandFrame">通信命令帧</param>
        /// <param name="responseFrame">通信回复帧</param>
        /// <param name="datas">数据列表</param>
        public FinsResult(bool isSuccessed, string resultMessage, string commandFrame, string responseFrame, List<bool> datas1, string datas2)
        {
            IsSuccessed = isSuccessed;
            ResultMessage = resultMessage;
            CommandFrame = commandFrame;
            ResponseFrame = responseFrame;
            Datas_BoolList = datas1;
            Datas_String = datas2;
        }

        //五参数构造函数（带bool数据列表）
        public FinsResult(bool isSuccessed, string resultMessage, string commandFrame, string responseFrame, List<bool> datas) :
            this(isSuccessed, resultMessage, commandFrame, responseFrame, datas, null)
        { }

        //五参数构造函数（带string数据列表）
        public FinsResult(bool isSuccessed, string resultMessage, string commandFrame, string responseFrame, string datas) :
            this(isSuccessed, resultMessage, commandFrame, responseFrame, null, datas)
        { }

        //四参数构造函数（无数据反馈）
        public FinsResult(bool isSuccessed, string resultMessage, string commandFrame, string responseFrame) :
            this(isSuccessed, resultMessage, commandFrame, responseFrame, null, null)
        { }

        //两参数构造函数（出错时返回）
        public FinsResult(bool isSuccessed, string resultMessage) : this(isSuccessed, resultMessage, null, null, null, null) { }

    }
}
